package com.besmart.workflow.core.model;

import java.util.ArrayList;
import java.util.List;

public class WorkflowNode {
	private String id;
	private List<OperationNode> operations;
	
	public WorkflowNode(String id)
	{
		this.id = id;
		operations = new ArrayList<OperationNode>();
	}
	
	public OperationNode getOperationById(String operationId)
	{
		for(OperationNode operation : operations)
		{
			if(operation.getDescriptor().getId().equals(operationId))
			{
				return operation;
			}
		}
		return null;
	}
	
	
	public void addOperation(OperationNode operation)
	{
		this.operations.add(operation);
	}

	public String getId() {
		return id;
	}

	public List<OperationNode> getOperations() {
		return operations;
	}
	
	
}
